<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <meta http-equiv="Content-Security-Policy" content="default-src 'self' 'unsafe-inline'">
    <style>
      [splash-theme="dark"]:not(.tw-loaded) {
        background-color: #222222;
      }
    </style>
  </head>
  <body>
    <div id="app"></div>
    <script>
      (function () {
        let theme = localStorage.getItem('tw:theme');
        if (theme === null) {
          theme = window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light';
        }
        document.body.setAttribute('splash-theme', theme);
      })();
    </script>
    <script>
      function webpackScriptError(event) {
        alert(`Error loading webpack script: ${event.target.src}`);
      }
    </script>
    <script src="index.js" onerror="webpackScriptError(event)"></script>
  </body>
</html>
